home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.input;
-
- import sub_arctic.lib.interactor;
-
- /**
- * Object to encapsulate some information that should be associated
- * associated with a particular interactor. These objects are currently used
- * in picking to record what part or subpart of the object was picked so that
- * this doesn't need to be recomputed.
- *
- * @author Scott Hudson
- */
- public class user_info_holder
- {
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The interactor that we are holding information for. */
- public interactor obj = null;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** An object providing the information we are holding. */
- public Object info = null;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Full constructor.
- *
- * @param interactor for_obj object we are associating information with.
- * @param Object user_info information we are associating.
- */
- public user_info_holder(interactor for_obj, Object user_info)
- {
- obj = for_obj;
- info = user_info;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Constructor with info defaulting to null.
- *
- * @param interactor for_obj object we are associating null information
- * with.
- */
- public user_info_holder(interactor for_obj)
- {
- this(for_obj, null);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Produce a hash code for the object and info. */
- public int hashCode()
- {
- return ((obj==null) ? 0 : obj.hashCode()) ^
- ((info==null) ? 0 : info.hashCode());
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Generic test for equality.
- *
- * @param Object other object we are testing equality against.
- */
- public boolean equals(Object other)
- {
- if (!(other instanceof user_info_holder)) return false;
- return equals((user_info_holder)other);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Type specific test for equality.
- *
- * @param user_info_holder other object we are testing equality against.
- */
- public boolean equals(user_info_holder other)
- {
- return (other.obj == obj) && (other.info == info);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-